#!/usr/bin/env python3
# -*- coding: utf-8 -*-
#
import json

# 保持某个时刻的状态值或持久存储
# 从磁盘或网络传递过来的字典或字符串转换成 一个可识别的序列


# with open("test.json", "rt", encoding="utf-8") as f:
#     json_str = f.read()
#
# print(json_str, type(json_str))   # 出来的就是一个字符串
#
# json_str = json.loads(json_str)
# print(json_str, type(json_str))  # 反序列化成一个字典

with open("test.json", "rt", encoding="utf-8") as f:
    json_str = json.load(f)

print(json_str, type(json_str))

